const webpack = require('webpack')
const { merge } = require('webpack-merge')
const commonConfig = require('./webpack.common')
const prodConfig = {
    //打包环境
    //production：压缩代码
    //development：不压缩代码
    mode: 'production',
    //cheap-仅限行  module-第三方包的错误也映射 eval-直接引用源代码  速度最快
    devtool: 'cheap-module-source-map',//production：压缩代码
    plugins: [
        new webpack.DefinePlugin({
          'process.env': require('../config/prod.env')
        }),
    ],
}

module.exports = merge(commonConfig, prodConfig)